<template>
	<view class="g-purchase-main g-main bottom">
		<view class="u-list f-bc-whilte f-mb7">
			<view class="u-item arrow border-bottom sm-border" @tap="toPage('/pages/carType/carType')">
				<text class="key required">销售单</text>
				<text class="value"></text>
			</view>
			<view class="u-item border-bottom sm-border">
				<text class="key">车辆数</text>
				<text class="value">6辆</text>
			</view>
			<view class="u-item border-bottom sm-border">
				<text class="key">调度人</text>
				<text class="value">黎明</text>
			</view>
			<view class="u-item border-bottom sm-border">
				<text class="key">调度时间</text>
				<text class="value">6辆</text>
			</view>
			<view class="u-item border-bottom sm-border">
				<text class="key">车辆名称</text>
				<text class="value">6辆</text>
			</view>
			<view class="u-item border-bottom sm-border">
				<text class="key">数量</text>
				<input type="number" v-model="dataForm.purchase_total" class="value" placeholder="" placeholder-class="ph" />
			</view>
		</view>

		<view class="u-list f-bc-whilte f-mb7">
			<view class="u-item arrow border-bottom sm-border" @tap="toPage('/pages/carType/carType')">
				<text class="key required">运输类型</text>
				<text class="value">自提</text>
			</view>
			<view class="u-item border-bottom sm-border">
				<text class="key">客户联系人</text>
				<input type="text" class="value" placeholder="输入客户名称" placeholder-class="ph" />
			</view>
			<view class="u-item border-bottom sm-border">
				<text class="key">客户联系电话</text>
				<input type="text" class="value" placeholder="输入联系电话" placeholder-class="ph" />
			</view>
			<view class="u-item arrow border-bottom sm-border">
				<text class="key required">物流名称</text>
				<text class="value">选择物流公司</text>
			</view>
			<view class="u-item price border-bottom sm-border">
				<text class="key">联系人</text>
				<text class="value">黎明</text>
			</view>
			<view class="u-item price border-bottom sm-border">
				<text class="key">联系电话</text>
				<text class="value">18259922440</text>
			</view>
			<view class="u-item arrow border-bottom sm-border">
				<text class="key required">预计发出时间</text>
				<text class="value">选择预计发出时间</text>
			</view>
			<view class="u-item arrow border-bottom sm-border">
				<text class="key required">预计送达时间</text>
				<text class="value">选择预计送达时间</text>
			</view>
			<view class="u-item arrow border-bottom sm-border">
				<text class="key required">预计送达时间</text>
				<text class="value">选择预计送达时间</text>
			</view>
			<view class="u-item arrow border-bottom sm-border">
				<text class="key required">起始地</text>
				<text class="value">选择起始地</text>
			</view>
			<view class="u-item arrow border-bottom sm-border">
				<text class="key required">目的地</text>
				<text class="value">选择目的地</text>
			</view>
			<view class="u-item empty border-bottom sm-border">
				<text class="key required">提车地</text>
				<input type="text" v-model="dataForm.purchase_total" class="value" placeholder="填写提车地" placeholder-class="ph" />
			</view>
			
			<view class="u-item empty border-bottom sm-border">
				<text class="key required">运费</text>
				<input type="number" v-model="dataForm.purchase_total" class="value" placeholder="填写提车地" placeholder-class="ph" />
			</view>
			
		</view>
		<view class="u-submit-btn-view"><button class="u-btn-primary f-fz16 f-fc-whilte">提 交</button></view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			dataForm: {
				purchase_type: '', // 采购类型
				car_type: '', // 车型名称
				out_color: '', // 外饰颜色
				int_color: '', // 内饰颜色
				num: '', // 台数
				purchase_price: '', // 采购价格
				purchase_total: '', // 采购总价
				first_price: '', // 定金
				shop_name: '', // 供应商名称
				shop_phone: '', // 供应商电话
				remark: '' // 备注
			},
			purchaseTypes: ['采购一', '采购二'],
			outColorList: ['白色', '黑色', '黄色'],
			intColorList: ['白色', '黑色', '黄色']
		};
	},
	onLoad() {
		uni.$on('selectCarType', type => {
			console.log('type');
			console.log(type);
		});
	},
	methods: {
		changeHandler(event) {
			const that = this;
			let key = event.target.dataset.key;
			let list = event.target.dataset.list;
			that.dataForm[key] = that[list][event.detail.value];
		}
	},
	onUnload() {
		uni.$off('selectCarType');
	}
};
</script>

<style lang="scss" scoped>
.u-item {
	.key {
		font-weight: 550;
	}
}
.u-submit-btn-view {
	padding: 120rpx 100rpx 100rpx;
	.u-submit-btn {
		margin-top: 80rpx;
	}
}
</style>
